package user.zc.excel.render;

import user.zc.excel.data.info.ICell;
import org.apache.poi.xssf.usermodel.XSSFCell;

class CellRender implements ICreate<XSSFCell, ICell.CellInfo> {
    private XSSFCell xssfCell;
    public CellRender(XSSFCell xssfCell){
        this.xssfCell = xssfCell;
    }

    @Override
    public XSSFCell next() {
        return null;
    }

    @Override
    public void draw(ICell.CellInfo data) {
        this.xssfCell.setCellType(data.getCellType());
        ITransfter.Context.set(xssfCell,data);
        if(data.getCra()!=null){
            this.xssfCell.getRow().getSheet().addMergedRegion(data.getCra());
        }
        new StyleRender(xssfCell).draw(data);
    }
}
